package com.hackerrank.challenges.countingsort4;

import java.util.LinkedList;
import java.util.Queue;
import java.util.Scanner;

public class Solution {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int n = in.nextInt(), h = n / 2, hc[] = new int[100];
		Queue<String>[] l = new LinkedList[100];
		for(int i = 0; i < l.length; i++)
			l[i] = new LinkedList<String>();
		for(int i = 0; i < h; i++) {
			hc[in.nextInt()]++;
			in.nextLine();
		}
		for(int i = h; i < n; i++)
			l[in.nextInt()].add(in.nextLine().substring(1));
		for(int i = 0; i < 100; i++) {
			for(int j = 0; j < hc[i]; j++)
				System.out.print("- ");
			while(!l[i].isEmpty())
				System.out.print(l[i].poll() + " ");
		}
		System.out.println();
	}
}
